﻿<?php 
    $id=empty($_GET['id'])?'':$_GET['id'];

    //新建数组用于重组的分类数组
 if(!empty($_POST)){

// print_r($_POST);die;
    $_POST['power']=implode(',', $_POST['power']);

      $_rows=edxit($GLOBALS['c'],$id,$_POST);
      
      
    if ($_rows>0) {
        echo '<script>alert("编辑成功"); location.href="index.php?c=role&a=list&admin=1";</script>';die;
        # code...
    }else{
        echo'<script>alert("编辑失败");history.go(-1);</script>';die;
    }

        
}
        $data=selectone('role',$id);

        $data['power']=explode(',',$data['power']);


        //查询父级和子集的数据

        $date=selectmore('power',"pid=0");
       
        $fei=selectmore('power',"pid!=0");
            // print_r($fei);die;

 
    
  
 include VIEW_PATH.$admin.'layout.html';
 //先做添加以作基础//

//编写插入数据的sql语句
